package com.jmb.api.common.mybatisplus;


import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@MapperScan("com.jmb.api.mapper")
public class MybatisPlusConfiguration {
    @Bean  // ✅ 必须添加的注解
    public MybatisPlusInterceptor mybatisPlusInterceptor() {  // ✅ 规范命名
        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
        // ✅ 指定数据库类型（建议保留）
        interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
        return interceptor;
    }
}
